﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>

<script type="text/javascript">

    function saveDeptInfo() {
        var deptId = $("#deptId").val();
        var pdeptId = $("#pardept").val();
        var deptName = $("#dept_Name").val();
        var deptCatal = $("#dept_Catal").val();
        var deptDescn = $("#dept_Descn").val();
        //alert(userstatus);
        $.ajax({
            type: "POST",
            url: "/Basic/DoUpdateDept",
            data: { "deptId": deptId, "pdeptId": pdeptId, "deptName": deptName, "deptCatal": deptCatal, "deptDescn": deptDescn },
            success: function(restag) {
                if (restag.res != true) {
                    alert(restag.msg);
                }
                else {
                    alert("操作成功");
                    $.fn.deltab('7-2-1');
                    $('#menu_alldeptlist').trigger('click');
                }
            }
        });
    }
</script>

<div style="margin-top: 5px;">
    <input type="button" value="保存" onclick="saveDeptInfo()" />
    <p style="margin: 10px 0;">
        上级部门:<%=Html.DropDownList("pardept", null, new { @style = "width:282px; margin-left:8px; padding:0px;border-radius:0px 0px 0px 0px;border:solid 1px #6C92AD;" })%></p>
    <p style="margin: 10px 0;">
        部门名称:<%=Html.TextBox("dept_Name", ViewData["deptName"], new { @style = "width:280px; margin-left:8px; border:solid 1px #6C92AD;" })%><%=Html.Hidden("deptId", ViewData["deptId"])%></p>
    <p style="margin: 10px 0;">
        部门分类:<%=Html.TextBox("dept_Catal", ViewData["deptCatal"],new { @style = "width:280px; margin-left:8px; border:solid 1px #6C92AD;" })%></p>
    <p style="margin: 10px 0; height: 100px;">
        <span style="float: left;">部门描述:</span> <span style="float: left;">
            <%=Html.TextArea("dept_Descn", ViewData["deptDescn"].ToString(), new { @style = "width:268px; height:85px; margin-left:8px;border-radius:0px 0px 0px 0px; border:solid 1px #6C92AD;" })%></span></p>
</div>
